package com.ptmall.app.ui.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/10/18.
 */

public class TradePagerAdapter extends FragmentPagerAdapter {

    private Context mContext;
    private List<Fragment> mFragments = new ArrayList<>();
    private List<String> mTabTitles;

    public TradePagerAdapter(FragmentManager fm, Context context, List<String> tabTitles, List<Fragment> fragments ) {
        super(fm);
        this.mContext = context;
        this.mFragments = fragments;
        this.mTabTitles = tabTitles;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTabTitles.get(position);
    }

}
